package demo01;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-23
 * Time: 15:07
 */
class Message<T> {
    private T message ;
    public T getMessage() {
        return message;
    }
    public void setMessage(T message) {
        this.message = message;
    }
}
public class Test04 {
        public static void main(String[] args) {
            Message<String> message = new Message() ;
            message.setMessage("10");
            fun(message); // 出现错误，只能接收String
        }
        public static void fun(Message<String> temp){
            System.out.println(temp.getMessage());
        }
}
